package com.ty.day3;

import java.util.Arrays;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create 2023/11/8 14:24
 */
public class Two {
    public static void main(String[] args) {
        int[] a = new int[10];
        int x, sqrt, res;
        for (int i = 0; i < a.length; i++) {
            x = (int) (Math.random() * 100);
            sqrt = (int) Math.sqrt(x);
            res = 0;
            if (sqrt <= 6) {
                res = (int) (Math.random() * 100);
            }
            a[i] = x + res;
        }
        for (int i = 0; i < a.length; i++) {
            for (int j = i+1; j < a.length; j++) {
                if (a[i]<=a[j]){
                    res=a[i];
                    a[i]=a[j];
                    a[j]=res;
                }
            }
        }
        System.out.println(Arrays.toString(a));
    }
}
